#include <public/config.h>
#include <public/uart_dev_getchar.h>
#include <public/basic_types.h>

#define STATUS_REG_OFFSET	0x05
#define DATA_REG_OFFSET	0x00
#define UART_DRA	0x01

void uart_dev_getchar(uint8_t *car)
{
	uint8_t lsr = 0;

	do {
		lsr = UART_REGISTER(STATUS_REG_OFFSET);
	} while (!(lsr & UART_DRA));

	*car = UART_REGISTER(DATA_REG_OFFSET);
}
